import java.util.Scanner;

public class sum {
    public static int printBit(int n){
        if(n/10==0){

            return n;
        }
       return n%10+ printBit(n/10);
    }
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("输入一个整数：");
        int n=scan.nextInt();
        System.out.println(printBit(n));
    }
}
